home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Arsenal - The Cutting Edge of Hacking / Hacker's Arsenal - The Cutting Edge of Hacking.iso / texts / hacking_unix.txt < prev    next >
Text File  |  2001-07-11  |  42KB  |  1,095 lines

  1. *> Press [X] to Abort / [CR] to Continue: []
  2.  
  3. *> Title:   Hacking UNIX
  4. *> Date:    6/10/89
  5. *> Time:    12:20 pm
  6.  
  7.  
  8.  
  9.  
  10.      /|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\
  11.      \|/                                                      \|/
  12.      /|\                                                      /|\
  13.      \|/        An Indepth Guide in Hacking UNIX and the      \|/ 
  14.      /|\           concept of Basic Networking Utility        /|\
  15.      \|/        ----------------------------------------      \|/
  16.      /|\                   By:Red Knight                      /|\
  17.      \|/        Phreakers/Hackers Underground Network         \|/
  18.      /|\                                                      /|\
  19.      \|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/
  20.  
  21. Brief history on UNIX
  22. ----------------------
  23. Its because of Ken Tompson that today were able to Hack Unix.He used to work
  24. for Bell Labs in the 60s.Tompson started out using the MULTICS OS which was
  25. later eliminated and Tompson was left without an operating system to work with.
  26. Tompson had to come up with something real quick.He did some research and
  27. and in 1969 UNIX came out,which was a single user and it didn't have
  28. many capabilities.A combined effort with others he rewrote the version
  29. in C and added some good features.This version was out in 1973 and was
  30. available to the public.This was the first begining of UNIX as its known      
  31. presently.The more refined version of UNIX,today know as UNIX system V      
  32. developed by Berkley University has unique capabilities.
  33. Various types of UNIXes are CPIX,Berkeley Ver 4.1,Berkeley 4.2,FOS,Genix,HP-UX,
  34. IS/I,OSx,PC-IX,PERPOS,Sys3,Ultrix,Zeus,Xenix,UNITY,VENIX,UTS,Unisys,Uniplus+,
  35. UNOS,Idris,QNIX,Coherent,Cromix,System III,System 7,Sixth edition.
  36.  
  37. The article it self:
  38. --------------------
  39. I believe that hacking into any system requires knowledge of the Operating
  40. system itself.Basically what I will try to do is make you more familiar with
  41. UNIX  operation ,its usefull commands that will be advantageous to you as a  
  42. hacker.This article contains in depth explainations.                      
  43.  
  44. Error Messages that one may came across:[UNIX system V]
  45. ----------------------------------------
  46. Login incorrect - An ivalid ID and/or pw was entered.This means nothing.
  47.                   In UNIX there is no way guessing valid user IDs.You may     
  48.                   come across this one when trying to get in.
  49. No more logins - will happens when the system wont accept anymore logins
  50.                  could be going down            
  51. Unknown Id - will happen if an ivalid id is entered using (su) command
  52. Unexpected eof in file - The file being stripped file has been damaged
  53. Your password has expired - This is quiet rare although there have been cases
  54.                             where it happened.Reading the etc/passwd will
  55.                             show you at how many intervals it changes.
  56. You may not change the password - The password has not yet aged enough.The
  57.                                   Administrator set the quotas for the users
  58. Unknown group [groups name] - occurs when chgrp is executed ,group doesn't
  59.                               exist
  60. Sorry - Indicated that you have typed in an invalid super user password(execu-
  61.         tion of the su)
  62. Permission denied!- Indicated you must be the owner or a super user to change
  63.                     password.
  64. Sorry <[# of weeks] since last change - This will happen when password has    
  65.                                         has not aged enough and you tried to
  66.                                         change it(passwd)
  67. [directory name]:no permission - You are trying to remove a directory which
  68.                                  you have no permission to.
  69. [file name] not removed - trying to delete a file owned by another user
  70.                           that you dont have write pemision for. 
  71. [dirname] not removed - ownership of the dir is not your that your trying to  
  72.                         delete. 
  73. [dirname] not empty - the directory contains files so you must have to delete
  74.                       the files before executing the rmdir 
  75. [command] not found - you have entered an ivalid command not know to UNIX
  76. cant execute pwd - some thing wrong with the system cant execute pwd command
  77. cannot chdir to .. -   (.. one level up) permision is required to execute pwd
  78.                        above the current directory
  79. cant open [file name] - defined wrong path,file name or you have no read
  80.                         permission
  81. cp:[file name] and [file name] are identical - self explanatory  
  82. cannot locate parent directory - occurs when using mv
  83. [file name] not found - file which your trying to move doesn't exsist
  84. You have mail - Self explanatory
  85.  
  86. Basic Networking Utility error messages
  87. ---------------------------------------
  88. cu:not found - networking not installed
  89. login failed - invalid id/pw or wrong # specified
  90. dial failed - the systen never answered due to a wrong #
  91. uucp completely failed - did not specify file after -s
  92. wrong time to call - you called at the time at a time not specified in the
  93.                      Systems file
  94. system not in systems - you called a remote not in the systems file
  95.  
  96. Logon format : first thing one must do is switch to lower case
  97. --------------
  98. Identifing a UNIX.Here is what you'll see:
  99. Some times there will be no system identifer
  100.                              
  101. AT&T UNIX SysVR3.0 (eg of a system identifier)
  102.  
  103. login:
  104.  or
  105. Login:
  106.  
  107. Any of these is a UNIX.Here is where you will have to guess at a user valid
  108. id.Here are some that I have come across eg( glr,glt,radgo,rml,chester,cat,
  109. lom,cora,hlto,hwill,edcasey and also some containing numbers smith1,mitu6 or
  110. special characters in it like bremer$,j#fox.Login names have to be 3 to 8
  111. chracters in lenght lowercase and must start with a letter.In some XENIX
  112. systems one may login as "guest"
  113.  
  114. User level accounts:(lower case)
  115. -------------------- 
  116. In Unix they have whats called accounts .These
  117. accounts can be used at the "login:" prompt.
  118. Here is a list:
  119.  
  120. sys
  121. bin
  122. trouble
  123. daemon
  124. uucp
  125. nuucp  
  126. rje
  127. lp
  128. adm
  129. listen - if starlan is installed
  130.  
  131. Super-user accounts:
  132. --------------------
  133. And then there are super-user login which make UNIX worth hacking.   
  134. The accounts are used for a specific job. In large systems these logins
  135. are assingned to users who have a responsibilty to maintain subsystems.
  136.  
  137. They are as follows :(all lower case)
  138.  
  139. root       -  this is a must the system comes configured with it.It has no
  140.               restriction.Has power over every other account.
  141. unmountsys -  unmounts files
  142. setup      -  system set up
  143. makefsys   -  makes a new file
  144. sysadm     -  allows useful S.A commands(doesn't need root login)
  145. powerdown  -  powering system down
  146. mountfsys  -  mounts files
  147. checkfsys  -  checks file
  148.  
  149. These accounts will definitly have passwords assigned to them.These
  150. accounts are also commands used by the system administrator.
  151.  
  152. Here are some examples of accounts I have seen:
  153.  
  154. cron         uuhelp     usenet
  155. anonuccp     news       network
  156. bellboy      lp         vector
  157. guest        games      ninja
  158. vote         warble     sysinfo
  159.  
  160.  
  161.  
  162. After the login prompt you will receive a password prompt:
  163.  
  164. password:
  165.   or
  166. Password:
  167.     
  168. Enter the password (it wont echo).The password rule is as follows:Each pw
  169. has to contain at least 6 characters and maximum has to be 8 .Two of which are
  170. to be alphabetic letters and at least one being a number or a special character
  171. The alphabetic digits could be in upper case or lower case.Here are some of the
  172. passwords that I have seen (eg.Ansuya1,PLAT00N6,uFo/78,ShAsHi..,Div417co)
  173.  
  174. The passwords for the super user accounts will be difficult to hack
  175. try  the accounts interchangebly eg.login:sysadm password:makefsys or rje1,
  176. sysop,sysop1,bin4 or they might contain letter,numbers,special chracters in
  177. them.It could be anything.The user passwords are changed by an aging proccess
  178. at successive intervals.The users are forced to changed it.The super-user
  179. will pick a password that wont need changing for a long period of time.
  180.  
  181. You have made it! 
  182. ----------------- 
  183. The hard part is over and hopefully you have hacked a super-user account.
  184. Remember Control-d stops a process and also logs you off.
  185. The next thing you'll probably see is the system news
  186. eg.
  187.  
  188. login:john 
  189. password:hacker1        
  190. System news                 
  191. There will be no networking offered to the users till
  192. august 15,due to hardware problems.             
  193. (just an example)
  194.  
  195. $
  196.  
  197. $ is the Unix prompt -waiting for a command to be entered.I will use this
  198.                       throught the article to show outouts etc..(Its not
  199.                       part of the command)
  200. # - means your logged in as root(very good)
  201.  
  202. A word about the XENIX System III:(run on the tandy 6000)
  203. ---------------------------------                  
  204. The largest weakness in the XENIX System III occurs after the installation
  205. of the Profile-16 or more commonly know as the filepro-16.I have seen the     
  206. filepro-16 installed in many systems.          
  207. The installation process creates an entry in the password file for a user  
  208. named \fBprofile\fR ,an account that who owns and administors the database.
  209. The great thing about it is that when the account is created ,no password is
  210. assigned to it.The database contains executable to maintain it.The database
  211. creation programs perform a \fBsetuid\fR to boot up the \fBoot\fR  there by 
  212. giving a person the whole C Shell to gain Super User privilege same as root.
  213. Intresting huh!
  214.                      
  215.  
  216. * Note: First the article will inform you of how the Unix is made up
  217.  
  218. The Unix is made if three components-The shell,the kernal,file system.
  219.  
  220. The kernal:
  221. -----------
  222. You could say that the kernal is the heart of the Unix operating system.
  223. The kernal is a low level language lower than the shell which maintains
  224. processes .The kernal handles memory usage ,maintains file system
  225. the sofware and hardware devices.
  226.  
  227. The shell:
  228. ----------
  229. The shell a higher level language. The shell had two important uses,
  230. to act as command interpreture for example using commands like cat,who,       
  231. ls the the shell is at work figuring out whether you have entered a command
  232. correctly or not.The second most important reason for the shell is its ability
  233. to be used as programing language.Suppose your performing some tasks      
  234. repeatedly over and over again,You can program the shell to do this for you.
  235.          
  236. The file system:   
  237. ---------------
  238. The file system in Unix is divede into 3 catagories:Directories,ordinary files
  239. and special files.(d,-)
  240.           
  241. Basic stucture:        
  242. (/)-this is abreviation for the root dirctory.
  243.   root level                      root
  244.                                   (/)                                  system
  245. -------------------------------------|----------------------------------level
  246. |      |        |         |                  |        |       |        |
  247. /unix   /etc    /dev      /tmp               /lib     /usr    /usr2    /bin
  248.         |                                        _____|_____
  249. login passwd                                     |    |    |
  250. level                                            /john  /cathy    
  251.                              ________________________|_______________
  252.                             |        |     |      |        |        |
  253.                         .profile   /mail  /pers  /games   /bin     /michelle
  254. *.profile - in case                        |    __|______  |      __|_______
  255.  you wich to change your enviroment     capital |        | data   |         |
  256. but after you log off.It sets to              othello  starwars letter letter1
  257. default.                                     
  258.  
  259. the /unix-is the kernal
  260. /etc - contains system administrators files,Most are not available to the
  261.        regular user.(this directory contains the /passwd file)
  262.  
  263.     Here are some files under /etc directory:
  264.     /etc/passwd
  265.     /etc/utmp
  266.     /etc/adm/sulog
  267.     /etc/motd
  268.     /etc/group
  269.     /etc/conf
  270.     /etc/profile
  271.   
  272. /dev - contains files for physical devices such as printer and the disk drives
  273. /tmp - temporary file directory
  274. /lib - dirctory that contains programs for high level languages
  275. /usr - this directory contains dirctories for each user on the system
  276.  
  277.      Eg. of a list of files under /usr
  278.     /usr/tmp
  279.     /usr/lib
  280.     /usr/docs
  281.     /usr/news
  282.     /usr/spool 
  283.     /usr/spool/lp
  284.     /usr/lib/uucp
  285.  
  286. /bin - contain executable programs (commands)
  287.  
  288. The root also contains:                                                       
  289. /bck - used to mount a back up file system.
  290. /install - Used to install and remove utilities
  291. /lost+found - This is where all the removed files go,This dir is used by fsck
  292.               (1M)
  293. /save -A utility used to save data
  294. /mnt - Used for temporary mounting
  295.  
  296. **Now the fun part scouting around**
  297.  
  298.                  Local commands (Explained in details)
  299.                  -------------------------------------
  300. At the unix prompt type the pwd command-it will show you the current working
  301. directory you are in.
  302.  
  303. $ pwd
  304. $ /usr/admin - assuming that you have hacked into a super user acc checkfsys
  305. $
  306.  
  307. This gives you the full login directory.The / before tell you the location
  308. of the root directory                     
  309.  
  310. or
  311.  
  312. (REFER TO THE DIAGRAM ABOVE)
  313. $ pwd
  314. $ /usr/john   
  315. $
  316. Assuming you have hacked into johns acc.
  317.  
  318. Now lets say you wanted to move down to the michelle directory( you own this)
  319. that contains letters.You would type in
  320.  
  321. $ cd michelle or cd usr/john/michelle
  322. $ pwd
  323. $ /usr/john/michelle
  324. $
  325.  
  326. Going back one directory up type in:
  327. $ cd ..
  328. or going to your parent directory just type in "cd"
  329.       
  330. Listing file directories assuming you are in the parent directory:
  331.  
  332. $ ls /usr/john
  333. mail
  334. pers
  335. games        
  336. bin
  337. michelle
  338. This wont give you the .profile file .To view it type
  339. $ cd
  340. $ ls -a
  341. :
  342. :
  343. .profile
  344.  
  345. To list file names in michelles directory type in:
  346. $ ls michelle (that if your in the johns directory)
  347. $ ls /usr/john/michelle(parent dir)
  348.  
  349. ls -l            
  350. -----             
  351. The ls -l is an an important command in unix.This command displays the whole
  352. directory in long format :Run this in parent directory
  353.  
  354. $ ls -l
  355. total 60
  356. -rwxr-x---    5 john      bluebox    10 april 9  7:04  mail
  357. drwx------    7 john      bluebox    30 april 2  4:09  pers
  358.      :            :         :         :     :      :    :
  359.      :            :         :         :     :      :    :
  360. -rwxr-x---     6 cathy    bluebox    13 april 1  13:00 partys
  361.      :            :         :         :     :      :    :
  362. $
  363.    
  364. The total 60 tells one the ammount of disk space used in a directory.The     
  365. -rwxr-x--- is read in triples of 3.The first chracter eg(-,d,b,c)-means as
  366. follows: - is an ordinary file ,d is a directory,b is block file,c is a
  367. chracter file.
  368. The r stands for read permission,w is write permission,x is execute.The first
  369. colum is read in 3 triples as stated above.The first group of 3 (in -rwxr-x---)
  370. after the "-" specifies the permission for the owner of the file,the second
  371. triple are for the groups (the fourth colum) and the last triple are the      
  372. permissions for all other users.Therefore the -rwxr-x--- is read as follows.
  373. The owner john has permission to read,write and execute anything in the bin
  374. directory but the group has no write permission to it and the rest of the users
  375. have no permission at all.The format of one of the lines in the above output
  376. is as follows:
  377.  
  378. file type-permissions,links,usersname,group,bytes taken,date,time when last
  379. renued,directory or file name.
  380. **You will be able to read,execute cathys file named party due to the same
  381. group***
  382.  
  383. chmod                    
  384. -----             
  385. The chmod command changes permission of a directory or a file.Format is
  386. chmod who+,-,=r,w,x
  387. The who is substituted by u-user,g-group,o-other users,a-all.
  388. The + means add permission,- means remove permission,= - assign.  
  389. Example :If you wanted all other users to read the file name mail ,type:   
  390.  
  391. $ chmod o+r mail
  392.  
  393. cat         
  394. ---          
  395. Now suppose you wanted to read the file letter .There are teo ways to doing
  396. this.First go to the michelle directory then type in:
  397.  
  398. $ cat letter
  399. line one ...\
  400. line two ... }the output of letter
  401. line three../
  402. $
  403.    or
  404. If you are in the parent directory type in:
  405. $ cat /usr/john/michelle/letter
  406. and you will have the same output.
  407.  
  408. Some cat options are  -s,-u,-v,-e,-t
  409.  
  410. Special Chracters in Unix:
  411. -------------------------
  412. *  - matches any number of single characters eg. ls john* will list
  413.      all files that begin with john
  414. [...] - matchs any one of the chracter in the [ ]
  415. ? - matches any single chracter
  416. runs a process in the backgroung leaving your terminal free
  417. $ - Values used for variables also $n - null argument
  418. > - redirectes output
  419. < - redirects input to come from a file
  420. >> - redirects command to be added to the end of a file
  421. | - pipe output (eg:who|wc-l tells us how many users are online)
  422. "..." - Turn of meaning of special chracters excluding $,`
  423. `...` - allows command output in to be used in a command line
  424. '...' - turns of special meaning of all chracters
  425.  
  426. continuation of local commands...[     ] -contains the options used
  427. ------------------------------- 
  428. passwd
  429. ------
  430. Password changing seems to be a big thing among the savants.Anyway to change
  431. the password one would use the 'passwd' command as shown below:
  432.  
  433.    $passwd
  434.    Changing password for john
  435.    Old password:                              
  436.    New password:                              
  437.    Retype new password:
  438.    $
  439.   
  440. This will only work when the password has aged enough
  441.  
  442. ps
  443. --
  444. Its sometimes necessary to see what command procesess you are running,this
  445. command lets you see that.
  446. ps [-a all processes except group leaders] [-e all processes] [-f the whole
  447.    list]                                                           
  448.  
  449.    $ps
  450.    PID   TTY  TIME   COMMAND
  451.    200   tty09 14:20  ps
  452.  
  453.    The systems reports (PID - process idenetification number which is a #
  454.    from 1-30,000 assigned to UNIX processes)
  455.    It also reports the TTY,TIME and the COMMAND being executed at the time.
  456.    To stop a process enter :    
  457.  
  458.    $kill [PID] (this case its 200)
  459.    200 terminated
  460.    $
  461.  
  462. grep
  463. ----
  464. This comand is important when seaching for a word or words in large files.
  465.  
  466. grep [argument] [file name] - searchs for an file that contains the argument
  467.                               for example:
  468.    $ grep phone cathy
  469.     phone   michelle  (718)5551234
  470.     phone   cindy   (718)5553456
  471.  
  472.     What this did was to find the argument 'phone' in the file cathy.If the
  473.     argument consists of two or more words then  it must be enclosed in single
  474.     quotes.
  475.  
  476.  
  477. mv
  478. --
  479. mv [file names(s)] [ dir name ] - renames a file or moves it to another     
  480.                                   directory eg.      
  481.    $mv letter letters 
  482.    $
  483.    This renames the file letter to letters thereby deleting letter
  484.                   or if you want to move files then
  485.    $mv /usr/john/pers/capital /usr/john/michelle/capital
  486.    $   
  487.    This moves the file capital to the directory named michelle
  488.  
  489. diff
  490. ----
  491. diff [file name] [ file name] - show diffrence between two files.Output of this
  492.                                 will have something like 4,5c4,5 then the it
  493.                                 will display both sets of files on the screen
  494.                                 The 4,5c4,5 means that you must change "c"
  495.                                 lines 4 to 5 in one file to line 4 to 5 in   
  496.                                 another.
  497.       Option for using this command are :
  498.        -b  -  it ignores blank spaces
  499.        -h  - compares it quickly
  500.        -s  - reports files that are the same
  501.        -S[file] - this is when you want to compare a directory starting at a
  502.                   specific file
  503.        
  504.  
  505.        There is also a command to compare 3 files which is :   
  506.  
  507.        diff3 [options] [file1] [file2] [file3]
  508.  
  509. cp
  510. --
  511. cp [file name] [file name] - makes a copy of a file
  512.  
  513.    $ cp letter letters
  514.    $
  515.    The file letters is a dupilcate copy of letter.In this case the original
  516.    is not erased like in the mv command
  517.  
  518.  
  519.  
  520. .... more UNIX commands:
  521. --------------------
  522.  
  523. man [command] or [c/r] -will give you a list of commands explainations
  524.  
  525. help - available on some UNIX systems
  526.                   
  527. mkdir [dir name(s)] - makes a directory      
  528.  
  529. rmdir [dir name(s)] - removes directory.You wont be able to remove the
  530.                       directory if it contains files in them
  531.  
  532. rm [file name(s)] - removes files. rm * will erase all files in the current
  533.                     dir.Be carefull you!!.Some options are :                
  534.                     [-f unconditional removal] [-i Prompts user for y or n]
  535.                         
  536. write [login name ] - to write to other logged in users.Sort of a chat
  537.  
  538. mesg [-n] [-y] - doesn't allow others to send you messages using the write
  539.                  command.Wall used by system adm overrides it.
  540.  
  541. $ [file name] - to execute any file
  542.  
  543. wc [file name] - Counts words,chracters,lines in a file
  544.  
  545. stty [modes] - Set terminal I/O for the current devices
  546.  
  547. sort [filename] - Sorts and merges files many options
  548.  
  549. spell [file name] > [file name] - The second file is where the misspelt words
  550.                                   are entered
  551.  
  552. date [+%m%d%y*] [+%H%%M%S] - Displays date acoording to options
  553.  
  554. at [-r] [-l] [job] - Does a specified job at a specified time.The -r Removes 
  555.                      all previously scheduled jobs.The -l reports the job #
  556.                      and status of all jobs scheduled
  557.  
  558. write [login] [tty] - Sends message to the login name.Chat!
  559.  
  560.  
  561.  
  562. su [login name]
  563. ---------------
  564. The su command allows one to switch user to a super user to a user.Very
  565. important could be used to switch to super user accounts.
  566. Usage:                                                
  567.  
  568. $ su sysadm
  569. password:
  570.  
  571. This su command will be monitored in /usr/adm/sulog and this file of all files
  572. is carefully monitered by the system administrator.Suppose you hacked in johns
  573. account and then switched to the sysadm account (ABOVE) your /usr/adm/sulog
  574. entry would look like:
  575.  
  576. SU  04/19/88  21:00 + tty 12 john-sysadm
  577.  
  578. Therfore the S.A(system administrator) would know that john swithed to sysadm
  579. account on 4/19/88 at 21:00 hours
  580.  
  581. Searching for valid login names:   
  582. -------------------------------
  583. Type in-
  584. $ who  ( command informs the user of other users on the system)
  585. cathy  tty1  april 19  2:30
  586. john   tty2  april 19  2:19
  587. dipal  tty3  april 19  2:31
  588. :
  589. :
  590. tty is the users terminal,date,time each logged on.dipal,john are valid
  591. logins.   
  592.  
  593. Files worth concatenating(cat)
  594. /etc/passwd file:                    
  595. -----------------                     
  596. The etc/passwd is a vital file to cat.For it contains login names of all
  597. users including super user accounts and there passwords.In the newer          
  598. SVR3 releases they are tighting their security by moving the encrypted
  599. passwords from /etc/passwd to /etc/shadow making it only readable by root.
  600. This is optional offcourse.
  601.  
  602. $ cat /etc/passwd
  603. root:D943/sys34:0:1:0000:/:
  604. sysadm:k54doPerate:0:0:administration:usr/admin:/bin/rsh
  605. checkfsys:Locked;:0:0:check file system:/usr/admin:/bin/rsh
  606. :
  607. other super user accs.
  608. :
  609. john:chips11:34:3:john scezerend:/usr/john:
  610. :
  611. other users
  612. :
  613. $
  614. If you have reached this far capture this file as soon as posible.
  615. This is a typical output etc/passwd file.The entries are seperated
  616. by a ":".There made be up to 7 fields in each line.
  617. Eg.sysadm account.
  618. The first is the login name in this case sysadm.The second field contains the
  619. password.The third field contains the user id."0 is the root".Then comes the
  620. group id then the account which contains the user full name etc .The sixth
  621. field is the login directory defines the full path name of the the particlar 
  622. account and the last is the program to be executed.          
  623. Now one can switch to other super user account using su command descibed above.
  624. The password entry in the field of the checkfsys account in the above example
  625. is "Locked;". This doesn't mean thats its a password but the account
  626. checkfsys cannot be accessed remotely.The ";" acts as an unused encryption
  627. chracter.A space is also used for the same purpose.You will find this in many
  628. UNIX systems that are small systems where the system administrator handles
  629. all maintaince.  
  630.  
  631. Password aging:  
  632. ---------------
  633. If password aging is active the user is forced to change the password at    
  634. regular intervals.One may be able to tell just by looking at the /etc/passwd
  635. file when the password is allowed to be changed and when it is compulsory to
  636. change it.
  637. For example the entry:
  638.  
  639. john:chips11,43:34:3:John Scezerend:/usr/john:
  640.  
  641. The password contains an extension of (,43) which mean that john can change has
  642. to change the password atleast evert 6 weeks and can keep it for atleast 3
  643. week.The format used is [password],Mmww.The M is the maxiumum number of weeks
  644. password has to be change and m is the minimum interval password can be changed
  645. and the ww is indicates when the password was last changed.
  646.  
  647.     Aging chart:
  648. ---------|-----------
  649. Character|# of weeks
  650.     .    |  0
  651.     /    |  1
  652.  0-9     | 2-11
  653.  A-Z     | 12-37
  654.  a-z     | 38-63
  655. ---------|-----------
  656.  
  657. From the above anyone can determine the number of weeks one can chnage the    
  658. password.         
  659.  
  660. The (ww) is automatically added as to when the password was last changed .   
  661.  
  662. IF SHAWDOWING IS ACTIVE:
  663. ------------------------
  664.  
  665. If the shawdowing is active the /etc/passwd would look like this:
  666.  
  667. root:x:0:1:0000:/:
  668. sysadm:x:0:0:administration:/usr/admin:/bin/rsh
  669.  
  670. The password filed is substituted by "x".
  671.  
  672. The /etc/shawdow file only readable by root will look similar to
  673. this:
  674.  
  675. root:D943/sys34:5288::
  676. :
  677. super user accounts
  678. :
  679. Cathy:masai1:5055:7:120
  680. :
  681. all other users
  682. :  
  683.  
  684. The first field contains users id:the second contains the password(The pw will
  685. be NONE if logining in remotely is deactivated):the third contains a code of
  686. when the password was last changed:the fourth and the fifth contains the 
  687. minimum and the maximum numbers of days for pw changes(Its rare that you will
  688. find this in the super user logins due to there hard to guess passwords)
  689.  
  690.   
  691. /etc/options directory
  692. -----------------------
  693. The etc/options dir will consists of utilities available in the system.
  694. Example:                  
  695. -rwxr-xr-x   1 root  sys   40 april  1:00  uucp.name                
  696. uucp standing for BNU
  697.  
  698. /etc/group
  699. -----------
  700. The file has each group on the system.Each line will have 4 entries separated
  701. by a ":" . Example of concatenated /etc/group:
  702.  
  703. root::0:root
  704. adm::2:adm,root
  705. bluebox::70:
  706.  
  707. Group name:password:group id:login names
  708. ** It very unlikely that groups will have passwords assigned to them **
  709. The id "0" is assigned to /
  710.  
  711. Sending and recieving messages:
  712. -------------------------------
  713. Two programs are used to manage this.They are mail & mailx.The difference
  714. between them is that mailx is more fancier thereby giving you many choices
  715. like replying message ,using editors etc.
  716. Sending:
  717. --------  
  718. The basic format for using this command is:
  719.  
  720. $mail [login(s)]
  721. (now one would enter the text
  722. after finishing enter "." a period
  723. on the next blank line)
  724. $
  725. This command is also used to send mail to remote systems.Suppose you wanted
  726. to send mail to john on a remote called ATT01
  727. you would type in:
  728.  
  729. $mail ATT01!john
  730.  
  731. Mail can be sent to several users,just by entering more login name after
  732. issuing the mail command
  733.  
  734. Using mailx is the same format:(This I'll describe very briefly)
  735. $mailx john
  736. subject:(this lets you enter the subject)
  737. (line #1)
  738. (line #2)
  739. (After you finish enter (~.) not the brackets offcourse ,more commands are
  740. available like ~p,~r,~v,~m,~h,~b etc.)
  741.  
  742. Receiving:
  743. ----------
  744. After you log on to the system you will the account may have mail waiting.
  745. You will be notified "you have mail".   
  746. To read this enter:       
  747. $mail
  748. (line #1)
  749. (line #2)
  750. (line #3)
  751. ?       
  752. $
  753. After the message you will be prompted with a question mark.Here you have a
  754. choice to delete it by entering d,saving it to view it later s,or just press
  755. enter to view the next message.
  756. (DONT BE A SAVANT AND DELETE THE POOR GUYS MAIL)
  757.  
  758. Super user commands:
  759. --------------------
  760. $sysadm adduser - will take you through a routine to add a user
  761.                  (may not last long)
  762.  
  763. Enter this:
  764.  
  765. $ sysadm adduser
  766. password:
  767. (this is what you will see)
  768. /--------------------------------------------------------------------------\
  769.   Process running succommmand `adduser`     
  770.   USER MANAGMENT
  771.  
  772.   Anytime you want to quit, type "q".
  773.   If you are not sure how to answer any prompt, type "?" for help
  774.  
  775.   If a default appears in the question,press <RETURN> for the default.
  776.  
  777.   Enter users full name [?,q]: (enter the name you want)                
  778.   Enter users login ID [?,q]:(the id you want to use)
  779.   Enter users ID number (default 50000) [?,q) [?,q]:( press return )
  780.   Enter group ID number or group name:(any name from /etc/group)
  781.   Enter users login home directory:(enter /usr/name)
  782.     
  783.   This is the information for the new login:
  784.   Users name: (name)
  785.   login ID:(id)
  786.   users ID:50000
  787.   group ID or name:     
  788.   home directory:/usr/name
  789.  Do you want to install,edit,skip [i,e,s,q]? (enter your choice if "i" then)
  790.  Login installed
  791.  Do you want to give the user a password?[y,n] (its better to enter one)
  792.  New password:
  793.  Re-enter password:   
  794.  
  795.  Do you want to add another login?
  796. \----------------------------------------------------------------------------/
  797.  
  798. This is the proccess to add a user.Since you hacked into a super user account
  799. you can make a super user account by doing the following by entering 0 as an
  800. user and a group ID and enter the home directory as /usr/admin.This will give
  801. you as much access as the account sysadm
  802. **Caution** - Do not use login names like Hacker,Cracker,Phreak etc .This is
  803. a total give away.                                                           
  804. The process of adding a user wont last very long the S.A will know when he
  805. checks out the /etc/passwd file
  806.  
  807. $sysadm moduser - This utility allows one to modify users.DO NOT ABUSE!!!
  808. Password:
  809.  
  810. This is what you'll see:
  811.  
  812. /----------------------------------------------------------------------------\
  813. MODIFYING USER'S LOGIN
  814.  
  815. 1)chgloginid  (This is to change the login ID)
  816. 2)chgpassword (Changing password)
  817. 3)chgshell (Changing directory DEFAULT = /bin/sh)
  818.  
  819. ENTER A NUMBER,NAME,INITIAL PART OF OF NAME,OR ? OR <NUMBER>? FOR HELP,
  820. Q TO QUIT ?
  821. \----------------------------------------------------------------------------/
  822.  
  823. Try every one of them out.Do not change someones password.It creates a havoc.
  824. If you do decide to change it.Please write the original one down somewhere
  825. and change back.Try not to leave to many traces after you had your fun.
  826. In choice number 1 you will be asked for the login and then the new one.
  827. In choice number 2 you will asked for the login and then supplied by it correct
  828. password and enter a new one.
  829. In choice 3 this is used to a pchange the login shell ** Use full **
  830. The above utilites can be used separatly for eg( To change a password one
  831. coulfd enter: $sysadm chgpasswd not chapassword ,The rest are same)
  832.  
  833. $sysadm deluser - This is an obviously to delete a user
  834. password: 
  835.    
  836. This will be the screen output:
  837. /---------------------------------------------------------------------------\
  838. Running subcommand 'deluser' from menu 'usermgmt'
  839. USER MANAGEMENT  
  840. This fuction completely removes the user,their mail file,home directory
  841. and all files below their home directory from the machine.
  842.  
  843. Enter login ID you wish to remove[q]:      (eg.cathy)
  844. 'cathy' belongs to 'Cathy Franklin'
  845. whose home directory is /usr/cathy
  846. Do you want to remove this login ID 'cathy' ? [y,n,?,q] : 
  847.  
  848. /usr/cathy and all files under it have been deleted.
  849.  
  850. Enter login ID you wish to remove [q]:
  851. \--------------------------------------------------------------------------/ 
  852. This command deletes everthing owned by the user.Dont use it even if you have
  853. access to it.
  854.  
  855.  
  856.  
  857. other super user commands:
  858. --------------------------
  859. wall [text] control-d  - to send an anouncement to users logged in(will
  860.                           override mesg -n command).Execute only from /     
  861. /etc/newgrp - is used to become a member of a group
  862.  
  863. sysadm [program name]
  864.         delgroup - delets groups
  865.         whoson - self explanatory
  866.         lsgroup - Lists group
  867.         mklineset -hunts various sequences
  868.         lsuser -lists all the users & their logins names
  869.  
  870. Other commands may require file system to be mounted.
  871.   
  872.  
  873.                        Basic Networking utility(BNU)
  874.                        -----------------------------
  875.  
  876. The BNU is a unique feature in UNIX.Some systems may not have this installed.
  877. What BNU does is allow other remote UNIXes communicate with yours without
  878. logging off the present one.BNU also allowes file transfer between computers.
  879. Most UNIX systems V will have this feature installed.
  880.  
  881. The user program like cu,uux etc are located in the /usr/bin directory
  882.  
  883. Basic Networking Files:
  884. -----------------------
  885. /usr/lib/uucp/[file name] 
  886.  [file name]
  887.  systems - cu command to establishes link.Contains info on remote computers
  888.            name,time it can be reached,login Id,password,telephone numbers
  889.  devices - inter connected with systems files(Automatic call unit same in two
  890.            entries)also cantains baud rate,port tty1 etc.
  891.                 
  892.  dialers - where asscii converation must be made before file tranfers etc.
  893.  dialcodes - contains abreiviations for phone numbers that can be used in
  894.              systems file
  895.  
  896.  other files are sysfiles,permissions,poll,devconfig
  897.  
  898. B.N.U Aministrative files:
  899. --------------------------
  900. There are 5 admnistrative files present.These are files are created in the
  901. /usr/spool directory .These A.Files are responsible for various BNU procceses
  902. like kepping records data ,files tranfers bettwenn remote and local and also
  903. usefull to lock devices.
  904.  
  905. TM - This file used to hold temporary data .When tranfering the files from a  
  906.      remote to local the /usr/spool/uucp/[name of the remote computer ] creates
  907.      this in the format of as of below:
  908.        
  909.      TM[Process Identification Number].[ddd]
  910.  
  911.      The ddd is the a 3 digit number (sequential) starting with "0"
  912.      Here a typical eg: TM322.012
  913.      Then this file is moved into the path defined by the C.sysnxxx file
  914.  
  915. X.[Execute files] - Created in the /usr/spool before you execute the commands
  916.                     in remote.
  917.                     The format used to name this file is X.sysnxxx
  918.                     where sys stand for the remote name and n is the priority
  919.                     level the xxxx is a sequence assingned by the uucp.These
  920.                     files always contain the Name of the file ,Comuter & file
  921.                     name to recieve,Persons login & computer name and the
  922.                     command string.
  923.  
  924. LCK - The lock file created in the /usr/spool/locks directory.The is used when
  925.       devices are being used.Prevent usage of the same calling device.
  926.       
  927.      Format used: LCK.str wher the str is a device name.The Lock file contains
  928.      the PID needed to lock
  929.  
  930. C.sysnxxx - created in the usr/spool directory.These are the work files.Used  
  931.             when work is in line,remote execeutions.Format is same as the     
  932.             X.sysnxxxx.The works files contain the full path name of the file
  933.             to be sent,path name of the destination (TM Transfers),Remote login
  934.             name to be notified after the file transmision is complete,Users
  935.             login name and the name of the programs used eg.uucp,uupick etc.
  936.           
  937. D - The data files.Format used is  D.systmxxxxyyy.These files are created when
  938.     specified in a command to copy to the spool directory.Eg. By the usage of
  939.     uucp -C this will be true.       
  940.     The systm is the remote name,xxxx is the the 4 digits seq assingned by
  941.     the uucp.The yyy is a sub sequence number.
  942.  
  943. Logining on to remote and sending+receiving files
  944. -------------------------------------------------
  945.  cu - This command allows one to log on to the local as well as the remote
  946.       Unix (or a non unix)without haveing to hang up so you can transfer files.
  947.       Usage:[options]
  948.  
  949.   $ cu [-s baud rate][-o odd parity][-e even parity][-l name of comm line]
  950.        telephone number | systemname
  951.  
  952.   To view system names that you can communicate with use the 'unname' command:
  953.   Eg. of output of names:
  954.  
  955.   ATT01
  956.   ATT02
  957.   ATT03
  958.   ATT04
  959.  
  960.  
  961. $ cu -s300 3=9872344 (9872344 is the tel#)
  962.  connected
  963.  login:
  964.  password:
  965.  
  966. local strings:
  967. --------------
  968. <~.> - will log you off the remote terminal but not the local
  969. ~! - out you on the local withiout disconnecting the line from remote
  970. <control-d> - puts you back on the remote unix
  971. ~%take [file name] - takes a copy of the file name and copies it to the
  972.                      local(the directory which you are in)
  973. "%put [file name] - reverse of above
  974. ~$[command] - allows the execution of a command to the local from remote
  975.  
  976. ct         
  977. --         
  978. ct allows local to connect to remote.Initiates a getty on a remote terminal.
  979. Usefull when using a remote terminal.BNU has call back feature that allows
  980. the user on the remote who can execute a call back meaning the local can call
  981. the remote.[   ] are options
  982.  
  983. $ ct [-h prevent automatic hang up][-s bps rate][-wt set a time to call back
  984.      abbrieviated t mins] telephone number
  985.  
  986. uux          
  987. ---        
  988. To execute commands on a remote (unix to unix)       
  989. usage:[  ] are options
  990.  
  991. $ uux [- use standard output][-n prevent mail notification][-p also use
  992.       standard output] command-string                        
  993.  
  994. uucp                              
  995. ----             
  996. uucp copies files from ones computer to the home directory
  997. of a user in remote system.This also works when copying files from one
  998. directory to another in the remote.The remote user will be notified by mail.
  999. This command becomes use full when copying files from a remote to your local
  1000. system.
  1001. The uucp requires the uucico daemon will call up the remote and will perform
  1002. file login sequence,file transfer and notify the user by mail.
  1003. Daemons are programs runining in the background.The 3 daemons in a Unix are
  1004. uucico,uusched,uuxqt.
  1005.  
  1006.  Daemons Explained:[nows a good time to explain the 3 daemons]
  1007.  ------------------
  1008.  
  1009.  uuxqt - Remote execution.This daemon is executed by uudemon.hour started by
  1010.          cron.UUXQT searchs in the spool directory for executable file
  1011.          named X.file sent from the remote system.When it finds a file X.file
  1012.          where it obtains process which are to be executed.The next step is 
  1013.          to find weather the processes are available at the time.The if     
  1014.          available it checks permission and if everthing is o.k it proceeds
  1015.          the background proccess.
  1016.  
  1017.  uucico - This Daemon is very immportant for it is responsible in establishing
  1018.           a connection to the remote also checks permission,performs login
  1019.           procedures,transfers + executes files and also notifies the user
  1020.           by mail.This daemon is called upon by uucp,uuto,uux commands.
  1021.  
  1022.  uusched - This is executed by the shell script called uudemon.hour
  1023.            This daemons acts as a randomizer before the UUCICO daemon is
  1024.            called.
  1025.  
  1026.  
  1027. Usage of uucp command:
  1028.  
  1029. $ uucp [options] [first full path name!] file [destination path!] file
  1030. example:
  1031. $ uucp -m -s bbss hackers unix2!/usr/todd/hackers
  1032.  
  1033. What this would do is send the file hackers from your computer to the remotes
  1034. /usr/todd/hackers making hackers offcourse as file.todd would mail that
  1035. a file has been sent to him.The unix2 is the name of the remote.
  1036. Options for uucp:(Dont forget to type in remotes name unix2 in case)         
  1037. -c  dont copy files to spool directory
  1038. -C  copy to spool
  1039. -s[file name] - this file will contain the file status(above is bbss)
  1040. -r  Dont start the comm program(uucico) yet
  1041. -j  print job number(for above eg.unix2e9o3)
  1042. -m  send mail when file file is complete
  1043.  
  1044. Now suppose you wanted to receive file called kenya which is in the usr/dan/usa
  1045.  to your home directory /usr/john assuming that the local systems name is
  1046. ATT01 and you are currently working in /usr/dan/usa,you would type in:
  1047.  
  1048. $uucp kenya ATT01!/usr/john/kenya
  1049.  
  1050. uuto         
  1051. ----          
  1052. The uuto command allows one to send file to remote user and can also be used
  1053. to send files locally.
  1054. Usage:
  1055. $ uuto [file name] [system!login name]( omit systen name if local)
  1056.  
  1057.  
  1058.  
  1059. Conclusion:
  1060. -----------
  1061. Theres always more one can say about the UNIX but its time to stop.
  1062. I hope you have enjoyed the article.I apologize for the lenght. I hope I
  1063. made the UNIX operating system more familiar.
  1064. Remember do not abuse any systems you hack into for a true hacker doesn't like
  1065. to reck but to learn.
  1066. I can be reached at (718)358/9209 - Hackers Den88 [2600 BBS #5]
  1067.  
  1068. Watch for my new article on using PANAMAC airline computers coming soon.
  1069.  
  1070.  
  1071.                            Red Knight
  1072.                              P/HUN!  
  1073.                            <<T.S.A.N>>
  1074.  
  1075. Leached off SSC (713) 497-2312
  1076.  
  1077. [13] [UNIX system specifics (all versions)]
  1078. (98) Minutes Remaining
  1079. (G-Files Menu) Command <?-Help>: [
  1080.  
  1081. X-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-X
  1082.  Another file downloaded from:                     The NIRVANAnet(tm) Seven
  1083.  
  1084.  & the Temple of the Screaming Electron   Taipan Enigma        510/935-5845
  1085.  Burn This Flag                           Zardoz               408/363-9766
  1086.  realitycheck                             Poindexter Fortran   510/527-1662
  1087.  Lies Unlimited                           Mick Freen           801/278-2699
  1088.  The New Dork Sublime                     Biffnix              415/864-DORK
  1089.  The Shrine                               Rif Raf              206/794-6674
  1090.  Planet Mirth                             Simon Jester         510/786-6560
  1091.  
  1092.                           "Raw Data for Raw Nerves"
  1093. X-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-X
  1094.